import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

// router
import router from './router/index.js'

// element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// pinia
import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
const pinia = createPinia()
pinia.use(piniaPluginPersist)


const app = createApp(App)

import * as ELIcons from '@element-plus/icons-vue'
for (let iconName in ELIcons) {
  app.component(iconName, ELIcons[iconName])
}

app.use(router); //注册router
app.use(ElementPlus,{
  locale: zhCn,
}); //注册element-plus
app.use(pinia); //注册pinia
app.mount('#app')